if (snmac) {
snprintf(desc, sizeof desc, "%s/%d Mbps/Ch %d", ssid, speed, channel);
- wpt_tmp->shortname = xstrdup(mac);
+ wpt_tmp->shortname = (mac);
} else {
snprintf(desc, sizeof desc, "%d Mbps/Ch %d/%s", speed, channel, mac);
- wpt_tmp->shortname = xstrdup(ssid);
+ wpt_tmp->shortname = (ssid);
}
- wpt_tmp->description = xstrdup(desc);
+ wpt_tmp->description = desc;
wpt_tmp->longitude = lon;
wpt_tmp->latitude = lat;
wpt_tmp->SetCreationTime(mktime(&tm));
for (i = 0, bh = htable; i < ct; i++, bh++) {
if (last_crc == bh->crc) {
-#if NEW_STRINGS
bh->wpt->shortname += QString("/%1").arg(++serial);
-#else
- char ssid[32 + 5 + 1];
- snprintf(ssid, sizeof ssid, "%s/%d", CSTRc(bh->wpt->shortname), ++serial);
- xfree(bh->wpt->shortname);
- bh->wpt->shortname = xstrdup(ssid);
-#endif
} else {
last_crc = bh->crc;
}
}
wpt = waypt_new();
- wpt->shortname = xstrdup(name);
+ wpt->shortname = name;
wpt->latitude = atof(lat);
wpt->longitude = atof(lon);
waypt_add(wpt);
/* try to read optional values */
if (((str = inifile_readstr(fin, sect, "Notes"))) && *str) {
- wpt->notes = xstrdup(str);
+ wpt->notes = str;
}
if (((str = inifile_readstr(fin, sect, "Time"))) && *str) {
wpt->SetCreationTime(EXCEL_TO_TIMET(atof(str)));
}
rte = route_head_alloc();
- rte->rte_name = xstrdup(name);
+ rte->rte_name = name;
route_add_head(rte);
for (wx = 0; wx < 0x3FFF; wx++) {
return NULL;
}
- wpt->shortname = lrtrim(xstrndup(str + 10, 9));
+ // The line has fixed columns and starts like:
+ // R 001 029 BEARHILL N42...
+ // Grab "BEARHILL" and whack trailing space.
+ wpt->shortname = QString(str).mid(10,9).trimmed();
if (rte_num) {
*rte_num = atoi(str + 2);